import {
	getCustomNavData
} from '@/util/util.js'
export default {
	cloudStorage: 'https://jinchang-job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/',
	methods: {
		navigate(url) {
			if (url) uni.navigateTo({
				url,
				success(e) {
					console.log(e)
				},
				fail(e) {
					console.log(e)
				}
			});
		},
		redirect(url) {
			if (url)
				uni.redirectTo({
					url
				});
		},
		back() {
			uni.navigateBack({
				fail() {
					uni.reLaunch({
						url: '/pages/home/index'
					})
				}
			})
		},
		call(phone) {
			uni.makePhoneCall({
				phoneNumber: phone
			})
		},
		openLocation(latitude, longitude, title) {
			uni.openLocation({
				latitude: latitude,
				longitude: longitude,
				name: title
			});
		},
	},
	computed: {
		mt() {
			let custom = getCustomNavData();
			return custom.statusBar + custom.nvaMartom + custom.navHeight + 20 + 'rpx';
		},
		showLoading() {
			return this.$store.getters.showLoading
		}
	},
	data() {
		return {
			topBgColor: '',
			cloudStorage: 'https://jinchang-job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/',
			imageStorage: 'https://jinchang-job-1306862033.cos.ap-chengdu.myqcloud.com/',
		}
	},
	onPageScroll(e) {
		this.topBgColor = e.scrollTop >= 1 ? '#0256FF' : 'rgba(0,0,0,0)'
	}
}